package bt;

import java.awt.Dimension;
import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import javax.swing.plaf.metal.MetalIconFactory;

public class JStatusBar extends JLabel {
    Border border;
    Icon icon;
    final static int TYP_WARN = 0;
    final static int TYP_WAIT = 1;
    /** Creates a new instance of StatusBar */
    public JStatusBar() {
        super();
        border = LineBorder.createGrayLineBorder();
        super.setPreferredSize(new Dimension(100, 16));
        super.setBorder(border);
    }

    public void setMessage(String message) {
        setText(" "+message);
    }

    public void setIcon(int typ){
        switch (typ){
            case TYP_WARN:
                icon = MetalIconFactory.getTreeComputerIcon();
                break;
            case TYP_WAIT:
                icon = MetalIconFactory.getTreeLeafIcon();

        }
        this.setIcon(icon);

    }
}